#include<stdio.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>

#define UNUSED(x) (void)x

void get_terminal_param(int param_argc, char *param_argv[])
{
    int opt, ret;
    char judge[10];

    while ((opt = getopt(param_argc, param_argv, "l:s:o:i:x:y:")) != -1) {
        switch (opt) {
            case 'l':
                if (atoi(optarg) < 0 || atoi(optarg) > 256) {
                    printf("ERROR: Input wrong length!\n");
                    system("stty echo");
                    exit(0);
                }
                break;

            case 's':
                ret = strlen(optarg);
                strcpy(judge, optarg);
                printf("%c\n", judge[0]);
                break;

            case 'o':
                if (atoi(optarg) < 0 || atoi(optarg) > 256) {
                    printf("ERROR: Input wrong color!\n");
                    system("stty echo");
                    exit(0);
                }
                break;

            case 'i':
                if (atoi(optarg) < 0 || atoi(optarg) > 256) {
                    printf("ERROR: Input wrong color!\n");
                    system("stty echo");
                    exit(0);
                }
                break;

            case 'x':
                if (atoi(optarg) < 0 || atoi(optarg) > 256) {
                    printf("ERROR: Input wrong color!\n");
                    system("stty echo");
                    exit(0);
                }
                break;

            case 'y':
                if (atoi(optarg) < 0 || atoi(optarg) > 256) {
                    printf("ERROR: Input wrong color!\n");
                    system("stty echo");
                    exit(0);
                }
                break;

            default:
                break;
        }
    }
}
int main(int argc, char* argv[])
{
    UNUSED(argc);
    UNUSED(argv);

    get_terminal_param(argc, argv);
}